package net.csdra.libraryborrowing.service.category;

import net.csdra.libraryborrowing.domain.category.Category;
import net.csdra.libraryborrowing.domain.user.UserAuthoriry;
import org.springframework.security.access.prepost.PreAuthorize;

/**
 * Created by msf on 2017/10/12.
 */
@PreAuthorize("hasRole('" + UserAuthoriry.USER_AUTHORIRY_MANGE + "')")
public interface CategoryManageService {
    public Category createCategory(CreateCategory createCategory);

    public Category updateCategory(UpdateCategory createCategory);


    class CreateCategory {
        String name;
        //分类简介
        String info;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getInfo() {
            return info;
        }

        public void setInfo(String info) {
            this.info = info;
        }
    }

    class UpdateCategory extends CreateCategory {
        String id;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }
    }
}

